fix(PinState): don't trigger sync when file's PinState changed to Unspecified.
authorCamila Ayres <hello@camilasan.com>
Thu, 3 Apr 2025 17:10:15 +0000 (19:10 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 15 Apr 2025 08:30:24 +0000 (08:30 +0000)
LibreOffice/Microsoft office might touch the files for unknown reasons,
creating a constant sync state (icon) visible in the parent folder.

This fix excludes PinState changes from a new sync if the trigger
might have been an external application.

Signed-off-by: Camila Ayres <hello@camilasan.com>
src/gui/folder.cpp

index 62aa980cd2ec23ffb27e864577e8175c2924b091..f0454c97fbff08d7e8de885318739788ef700d5e 100644 (file)
@@ -652,8 +652,11 @@ void Folder::slotWatchedPathChanged(const QStringView &path, const ChangeReason
         if (record.isValid()
             && !FileSystem::fileChanged(path.toString(), record._fileSize, record._modtime) && _vfs) {
             spurious = true;
-
             if (auto pinState = _vfs->pinState(relativePath.toString())) {
+                qCDebug(lcFolder) << "PinState for" << relativePath << "is" << *pinState;
+                if (*pinState == PinState::Unspecified) {
+                    spurious = false;
+                }
                 if (*pinState == PinState::AlwaysLocal && record.isVirtualFile()) {
                     spurious = false;
                 }